
<#include "/common/head.html"/>

 <div class="easyui-panel addPage" data-options="fit:true,border:false,novalidate:true">
    <form class="easyui-form" id="ff" method="post" data-options="novalidate:true">
        <table class="table1">
        	
            <tr>
           		<th><span>用户名：</span></th>
               	<td>
               		<input class="easyui-textbox" type="text" name="user_name" value="" data-options=""></input>
           		</td>
           	</tr>
            <tr>
           		<th><span>密码：</span></th>
               	<td>
               		<input class="easyui-textbox" type="password" name="password" value="" data-options=""></input>
           		</td>
            </tr>
            <tr>
           		<th><span>角色：</span></th>
               	<td>
	            	<input class="easyui-combobox" id="roles" name="roles" value="" data-options="
	            				valueField: 'id',
   								textField: 'text',
	            				data: [
	            					{id:'', text:''}<#list dictDataroles.keySet() as key>,{id:'${key}', text:'${dictDataroles.get(key)}'}</#list>
	            				]
	            				
	            	" />        	
           		</td>            
            </tr>           
        </table>
    </form>
</div>
<script>
top.window.subPage.save = save;
function save() {
	if($("#ff").form('enableValidation').form('validate')) {
		$.post("add", getParam(), function(data) {
			top.window.closeWindow();
			top.window.subPage.loadCurrDatagrid();
		});
	}
}
function getParam() {
	var param = {
	     
       	    "model.user_name": getInputValue("user_name"), 
       	    "model.password": getInputValue("password"), 
       	    "model.roles":  getInputValue("roles"), 
	}
	for(key in param) {
		if(!param[key]) {
			delete param[key];
		}
	}
	return param;
}

//扩展js
$(function() {
 changeComboboxToMult("roles");
});;
</script>
<#include "/common/foot.html"/>
